{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function Abstraction.create at 0x11117bea0>\n",
      "done\n",
      "entring scope <function Abstraction.create at 0x11117bea0>\n",
      "done\n",
      "entring scope <function Abstraction.__add__ at 0x11118c158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function Abstraction.create at 0x11117bea0>\n",
      "done\n",
      "entring scope <function Abstraction.__call__ at 0x11117bf28>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function Pair.create at 0x1111a3950>\n",
      "done\n",
      "entring scope <function Pair.left at 0x1111a3a60>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function Pair.create at 0x1111a3950>\n",
      "done\n",
      "entring scope <function Pair.right at 0x1111a39d8>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function Maybe.nothing at 0x11118cea0>\n",
      "done\n",
      "entring scope <function Maybe.match at 0x1111aa0d0>\n",
      "done\n",
      "entring scope <function Maybe.just at 0x1111aa048>\n",
      "done\n",
      "entring scope <function Maybe.match at 0x1111aa0d0>\n",
      "done\n",
      "entring scope <function Abstraction.__call__ at 0x11117bf28>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function Maybe.nothing at 0x11118cea0>\n",
      "done\n",
      "entring scope <function Maybe.nothing at 0x11118cea0>\n",
      "done\n",
      "entring scope <function Maybe.__or__ at 0x1111aa158>\n",
      "done\n",
      "entring scope <function Maybe.nothing at 0x11118cea0>\n",
      "done\n",
      "entring scope <function Maybe.just at 0x1111aa048>\n",
      "done\n",
      "entring scope <function Maybe.__or__ at 0x1111aa158>\n",
      "done\n",
      "entring scope <function Maybe.just at 0x1111aa048>\n",
      "done\n",
      "entring scope <function Maybe.just at 0x1111aa048>\n",
      "done\n",
      "entring scope <function Maybe.__or__ at 0x1111aa158>\n",
      "done\n",
      "entring scope <function Maybe.just at 0x1111aa048>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function Maybe.nothing at 0x11118cea0>\n",
      "done\n",
      "entring scope <function Maybe.__and__ at 0x1111aa1e0>\n",
      "done\n",
      "entring scope <function Maybe.nothing at 0x11118cea0>\n",
      "done\n",
      "entring scope <function Maybe.nothing at 0x11118cea0>\n",
      "done\n",
      "entring scope <function Maybe.__and__ at 0x1111aa1e0>\n",
      "done\n",
      "entring scope <function Maybe.nothing at 0x11118cea0>\n",
      "done\n",
      "entring scope <function Maybe.just at 0x1111aa048>\n",
      "done\n",
      "entring scope <function Maybe.just at 0x1111aa048>\n",
      "done\n",
      "entring scope <function Maybe.__and__ at 0x1111aa1e0>\n",
      "done\n",
      "entring scope <function Pair.create at 0x1111a3950>\n",
      "done\n",
      "entring scope <function Maybe.just at 0x1111aa048>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function Converter.convert at 0x11118cd08>\n",
      "done\n",
      "entring scope <function Maybe.just at 0x1111aa048>\n",
      "done\n",
      "entring scope <function Maybe.just at 0x1111aa048>\n",
      "done\n",
      "entring scope <function Converter.convert at 0x11118cd08>\n",
      "done\n",
      "entring scope <function Maybe.just at 0x1111aa048>\n",
      "done\n",
      "entring scope <function Maybe.nothing at 0x11118cea0>\n",
      "done\n",
      "entring scope <function Converter.convert at 0x11118cd08>\n",
      "done\n",
      "entring scope <function Maybe.nothing at 0x11118cea0>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function Converter.convert at 0x11118cd08>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function Either.left at 0x11118cb70>\n",
      "done\n",
      "entring scope <function Either.match at 0x11118cf28>\n",
      "done\n",
      "entring scope <function Either.right at 0x11118c950>\n",
      "done\n",
      "entring scope <function Either.match at 0x11118cf28>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function Converter.convert at 0x11118cd08>\n",
      "done\n",
      "entring scope <function Abstraction.from_fn at 0x11118c048>\n",
      "done\n",
      "entring scope <function Maybe.map at 0x1111aa268>\n",
      "done\n",
      "entring scope <function Converter.convert at 0x11118cd08>\n",
      "done\n",
      "entring scope <function Abstraction.from_fn at 0x11118c048>\n",
      "done\n",
      "entring scope <function Maybe.map at 0x1111aa268>\n",
      "done\n",
      "entring scope <function Converter.convert at 0x11118cd08>\n",
      "done\n",
      "entring scope <function Maybe.__or__ at 0x1111aa158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function Boolean.create at 0x1111aaae8>\n",
      "done\n",
      "entring scope <function Boolean.if_ at 0x1111aa9d8>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function Converter.convert at 0x11118cd08>\n",
      "done\n",
      "entring scope <function Boolean.create at 0x1111aaae8>\n",
      "done\n",
      "entring scope <function Maybe.just at 0x1111aa048>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function Integer.from_int at 0x1111aaea0>\n",
      "done\n",
      "entring scope <function Integer.from_int at 0x1111aaea0>\n",
      "done\n",
      "entring scope <function Integer.__add__ at 0x1111aa7b8>\n",
      "done\n",
      "entring scope <function Integer.from_int at 0x1111aaea0>\n",
      "done\n",
      "entring scope <function Integer.from_int at 0x1111aaea0>\n",
      "done\n",
      "entring scope <function Integer.__sub__ at 0x1111aa6a8>\n",
      "done\n",
      "entring scope <function Integer.from_int at 0x1111aaea0>\n",
      "done\n",
      "entring scope <function Integer.from_int at 0x1111aaea0>\n",
      "done\n",
      "entring scope <function Integer.__mul__ at 0x1111a3268>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function Integer.from_int at 0x1111aaea0>\n",
      "done\n",
      "entring scope <function Integer.from_int at 0x1111aaea0>\n",
      "done\n",
      "entring scope <function Integer.eq at 0x1111a3158>\n",
      "done\n",
      "entring scope <function Integer.__lt__ at 0x1111a30d0>\n",
      "done\n",
      "entring scope <function Integer.__le__ at 0x1111a3598>\n",
      "done\n",
      "entring scope <function Integer.__gt__ at 0x1111a3510>\n",
      "done\n",
      "entring scope <function Integer.__ge__ at 0x1111a36a8>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function Converter.convert at 0x11118cd08>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_iterated_placeholder at 0x111113e18>\n",
      "done\n",
      "entring scope <function Vec.create at 0x11116ebf8>\n",
      "done\n",
      "entring scope <function Integer.from_int at 0x1111aaea0>\n",
      "done\n",
      "entring scope <function Vec.__getitem__ at 0x11116eea0>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_iterated_placeholder at 0x111113e18>\n",
      "done\n",
      "entring scope <function Vec.create at 0x11116ebf8>\n",
      "done\n",
      "entring scope <function Vec.map at 0x11116eb70>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_iterated_placeholder at 0x111113e18>\n",
      "done\n",
      "entring scope <function Vec.create at 0x11116ebf8>\n",
      "done\n",
      "entring scope <function Vec.append at 0x11116eae8>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function Converter.convert at 0x11118cd08>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function IntCompat.from_maybe_integer at 0x1157e1d90>\n",
      "done\n",
      "entring scope <function Converter.convert at 0x11118cd08>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function TupleIntCompat.from_vec_integer at 0x115855400>\n",
      "done\n",
      "entring scope <function Converter.convert at 0x11118cd08>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function NDArray.from_ndarray at 0x115855730>\n",
      "done\n",
      "entring scope <function NDArray.to_ndarray at 0x1158556a8>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function Maybe.just at 0x1111aa048>\n",
      "done\n",
      "entring scope <function NDArrayCompat.from_ndarray at 0x115855b70>\n",
      "done\n",
      "entring scope <function NDArrayCompat.to_ndarray at 0x115855bf8>\n",
      "done\n",
      "entring scope <function NDArray.to_ndarray at 0x1158556a8>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function Maybe.just at 0x1111aa048>\n",
      "done\n",
      "entring scope <function NDArrayCompat.from_ndarray at 0x115855b70>\n",
      "done\n",
      "entring scope <function Maybe.just at 0x1111aa048>\n",
      "done\n",
      "entring scope <function NDArrayCompat.from_ndarray at 0x115855b70>\n",
      "done\n",
      "entring scope <function NDArrayCompat.__add__ at 0x115855ae8>\n",
      "done\n",
      "entring scope <function NDArray.__add__ at 0x115855620>\n",
      "done\n",
      "entring scope <function Maybe.just at 0x1111aa048>\n",
      "done\n",
      "entring scope <function NDArrayCompat.from_ndarray at 0x115855b70>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function NDArrayCompat.from_ndarray at 0x115855b70>\n",
      "done\n",
      "entring scope <function Converter.convert at 0x11118cd08>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function Integer.from_int at 0x1111aaea0>\n",
      "done\n",
      "entering scope <function unbox_integer at 0x115850ea0>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function arange_ at 0x1158551e0>\n",
      "done\n",
      "entring scope <function NDArray.to_ndarray at 0x1158556a8>\n",
      "done\n",
      "entering scope <function unbox_integer at 0x115850ea0>\n",
      "done\n",
      "entering scope <function arange at 0x115855d90>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function NDArray.__add__ at 0x115855620>\n",
      "done\n",
      "entring scope <function NDArray.to_ndarray at 0x1158556a8>\n",
      "done\n",
      "entring scope <function NDArray.to_ndarray at 0x1158556a8>\n",
      "done\n",
      "entring scope <function NDArray.to_ndarray at 0x1158556a8>\n",
      "done\n",
      "entering scope <function ndarray_add at 0x1158617b8>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function Either.left at 0x11118cb70>\n",
      "done\n",
      "entering scope <function unbox_idxs at 0x115872730>\n",
      "done\n",
      "entering scope <function unbox_integer at 0x115850ea0>\n",
      "done\n",
      "entering scope <function create_iterated_placeholder at 0x111113e18>\n",
      "done\n",
      "entring scope <function Vec.create at 0x11116ebf8>\n",
      "done\n",
      "entring scope <function Either.right at 0x11118c950>\n",
      "done\n",
      "entering scope <function unbox_idxs at 0x115872730>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function NDArray.__getitem__ at 0x115855048>\n",
      "done\n",
      "entring scope <function NDArray.to_ndarray at 0x1158556a8>\n",
      "done\n",
      "entring scope <function NDArray.to_ndarray at 0x1158556a8>\n",
      "done\n",
      "entering scope <function unbox_idxs at 0x115872730>\n",
      "done\n",
      "entering scope <function ndarray_getitem at 0x115861048>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function FunctionZero.__call__ at 0x115872510>\n",
      "done\n",
      "entring scope <function FunctionZero.value at 0x115872620>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function FunctionOne.__call__ at 0x115872ae8>\n",
      "done\n",
      "entring scope <function FunctionOne.abstraction at 0x115872bf8>\n",
      "done\n",
      "entring scope <function Abstraction.__call__ at 0x11117bf28>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function FunctionTwo.__call__ at 0x115872ea0>\n",
      "done\n",
      "entring scope <function FunctionTwo.abstraction at 0x115861bf8>\n",
      "done\n",
      "entring scope <function Abstraction.__call__ at 0x11117bf28>\n",
      "done\n",
      "entring scope <function Abstraction.__call__ at 0x11117bf28>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function FunctionThree.__call__ at 0x115861510>\n",
      "done\n",
      "entring scope <function FunctionThree.abstraction at 0x115861c80>\n",
      "done\n",
      "entring scope <function Abstraction.__call__ at 0x11117bf28>\n",
      "done\n",
      "entring scope <function Abstraction.__call__ at 0x11117bf28>\n",
      "done\n",
      "entring scope <function Abstraction.__call__ at 0x11117bf28>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function FunctionZero.create at 0x115872598>\n",
      "done\n",
      "entring scope <function FunctionZero.value at 0x115872620>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function FunctionOne.create at 0x115872b70>\n",
      "done\n",
      "entring scope <function FunctionOne.abstraction at 0x115872bf8>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function FunctionTwo.create at 0x115872f28>\n",
      "done\n",
      "entring scope <function FunctionTwo.abstraction at 0x115861bf8>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entering scope <function create_wildcard_expession at 0x11117b158>\n",
      "done\n",
      "entring scope <function FunctionThree.create at 0x115861598>\n",
      "done\n",
      "entring scope <function FunctionThree.abstraction at 0x115861c80>\n",
      "done\n"
     ]
    }
   ],
   "source": [
    "from metadsl import *\n",
    "from metadsl_core import *\n",
    "\n",
    "import metadsl_visualize\n",
    "\n",
    "import typez\n",
    "typez.SHOW_TYPES = True"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "entring scope <function FunctionTwo.from_fn at 0x115872c80>\n",
      "done\n"
     ]
    }
   ],
   "source": [
    "@FunctionTwo.from_fn\n",
    "def add(a: Integer, b: Integer) -> Integer:\n",
    "    return a + b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "entring scope <function FunctionTwo.from_fn at 0x115872c80>\n",
      "done\n"
     ]
    },
    {
     "data": {
      "application/json": {
       "nodes": {
        "-20600624907915588": [
         "-20600624907915588",
         {
          "args": [
           "-4485477713160206705",
           "-5875961188073735461"
          ],
          "function": "Integer.__add__"
         }
        ],
        "-2601574970510395267": [
         "-2601574970510395267",
         {
          "args": [
           "4117663596895676661"
          ],
          "function": "Abstraction.from_fn"
         }
        ],
        "-2626880919931084916": [
         "-2626880919931084916",
         {
          "repr": "'add'",
          "type": "str"
         }
        ],
        "-4485477713160206705": [
         "-4485477713160206705",
         {
          "args": [
           "-5085883562703833547"
          ],
          "function": "Abstraction.create_variable",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "params": {
             "T": {
              "type": "Integer"
             },
             "U": {
              "type": "Integer"
             }
            },
            "type": "Abstraction"
           }
          }
         }
        ],
        "-5085883562703833547": [
         "-5085883562703833547",
         {
          "repr": "Variable(4660943000)",
          "type": "Variable"
         }
        ],
        "-5537016880100348786": [
         "-7803251851758211739",
         {
          "args": [
           "-4485477713160206705",
           "-8505639159044087460"
          ],
          "function": "Abstraction.create",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "params": {
             "T": {
              "type": "Integer"
             },
             "U": {
              "type": "Integer"
             }
            },
            "type": "Abstraction"
           }
          }
         }
        ],
        "-5875961188073735461": [
         "-5875961188073735461",
         {
          "args": [
           "4137483036310687436"
          ],
          "function": "Abstraction.create_variable",
          "type_params": {
           "T": {
            "repr": "~U"
           },
           "U": {
            "repr": "~V"
           }
          }
         }
        ],
        "-7803251851758211739": [
         "-7803251851758211739",
         {
          "args": [
           "4117663685757988861"
          ],
          "function": "Abstraction.from_fn"
         }
        ],
        "-8505639159044087460": [
         "-2601574970510395267",
         {
          "args": [
           "-5875961188073735461",
           "-20600624907915588"
          ],
          "function": "Abstraction.create",
          "type_params": {
           "T": {
            "repr": "~U"
           },
           "U": {
            "repr": "~V"
           }
          }
         }
        ],
        "-8543162192516159022": [
         "6626111992951741011",
         {
          "args": [
           "-2626880919931084916",
           "-5537016880100348786"
          ],
          "function": "FunctionTwo.create",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "type": "Integer"
           },
           "V": {
            "type": "Integer"
           }
          }
         }
        ],
        "-8614089537398948180": [
         "6626111992951741011",
         {
          "args": [
           "-2626880919931084916",
           "-7803251851758211739"
          ],
          "function": "FunctionTwo.create",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "type": "Integer"
           },
           "V": {
            "type": "Integer"
           }
          }
         }
        ],
        "1420165815779654667": [
         "1420165815779654667",
         {
          "repr": "<function add at 0x115cc9d90>",
          "type": "function"
         }
        ],
        "4117663596895676661": [
         "4117663596895676661",
         {
          "repr": "FunctionReplaceTyping(fn=<function FunctionTwo.from_fn.<locals>.inner.<locals>.inner_inner at 0x115cfbbf8>, typevars={~T: <class 'metadsl_core.integer.Integer'>, ~U: metadsl_core.abstraction.Abstraction[metadsl_core.integer.Integer, metadsl_core.integer.Integer]}, inner_mapping=<function replace_typevars_expression.<locals>.<lambda> at 0x115ccef28>)",
          "type": "FunctionReplaceTyping"
         }
        ],
        "4117663685757988861": [
         "4117663685757988861",
         {
          "repr": "FunctionReplaceTyping(fn=<function FunctionTwo.from_fn.<locals>.inner at 0x115cfb048>, typevars={~U: <class 'metadsl_core.integer.Integer'>, ~T: <class 'metadsl_core.integer.Integer'>, ~V: <class 'metadsl_core.integer.Integer'>}, inner_mapping=<function replace_typevars_expression.<locals>.<lambda> at 0x115ccec80>)",
          "type": "FunctionReplaceTyping"
         }
        ],
        "4137483036310687436": [
         "4137483036310687436",
         {
          "repr": "Variable(4580951264)",
          "type": "Variable"
         }
        ],
        "5106739603382598765": [
         "-7803251851758211739",
         {
          "args": [
           "-4485477713160206705",
           "-2601574970510395267"
          ],
          "function": "Abstraction.create",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "params": {
             "T": {
              "type": "Integer"
             },
             "U": {
              "type": "Integer"
             }
            },
            "type": "Abstraction"
           }
          }
         }
        ],
        "6626111992951741011": [
         "6626111992951741011",
         {
          "args": [
           "1420165815779654667"
          ],
          "function": "FunctionTwo.from_fn"
         }
        ],
        "8630295114445134855": [
         "6626111992951741011",
         {
          "args": [
           "-2626880919931084916",
           "5106739603382598765"
          ],
          "function": "FunctionTwo.create",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "type": "Integer"
           },
           "V": {
            "type": "Integer"
           }
          }
         }
        ]
       },
       "states": {
        "initial": "6626111992951741011",
        "states": [
         {
          "node": "-8614089537398948180",
          "rule": "metadsl_core.function.FunctionTwo.from_fn"
         },
         {
          "node": "8630295114445134855",
          "rule": "metadsl_core.abstraction.Abstraction.from_fn"
         },
         {
          "node": "-8543162192516159022",
          "rule": "metadsl_core.abstraction.Abstraction.from_fn"
         },
         {
          "label": "core",
          "node": "-8543162192516159022",
          "rule": ""
         }
        ]
       }
      },
      "application/x.typez.graph+json": {
       "initial": "digraph {\n\tnode [shape=plain]\n\tedge [arrowsize=0.5 penwidth=0.5]\n\t6626111992951741011 [label=\"FunctionTwo.from_fn\" id=6626111992951741011]\n\t6626111992951741011 -> 1420165815779654667 [id=\"6626111992951741011.args[0]\"]\n\t1420165815779654667 [label=\"function add at 0x115cc9d90\" id=1420165815779654667]\n}",
       "states": [
        {
         "graph": "digraph {\n\tnode [shape=plain]\n\tedge [arrowsize=0.5 penwidth=0.5]\n\t-8614089537398948180 [label=\"FunctionTwo.create\" id=6626111992951741011]\n\t-8614089537398948180 -> -2626880919931084916 [id=\"6626111992951741011.args[0]\"]\n\t-2626880919931084916 [label=\"'add'\" id=-2626880919931084916]\n\t-8614089537398948180 -> -7803251851758211739 [id=\"6626111992951741011.args[1]\"]\n\t-7803251851758211739 [label=\"Abstraction.from_fn\" id=-7803251851758211739]\n\t-7803251851758211739 -> 4117663685757988861 [id=\"-7803251851758211739.args[0]\"]\n\t4117663685757988861 [label=\"FunctionReplaceTyping(fn=function FunctionTwo.from_fn.locals.inner at 0x115cfb048, typevars={~U: class 'metadsl_core.integer.Integer', ~T: class 'metadsl_core.integer.Integer', ~V: class 'metadsl_core.integer.Integer'}, inner_mapping=function replace_typevars_expression.locals.lambda at 0x115ccec80)\" id=4117663685757988861]\n\t-8614089537398948180.0 [label=Integer]\n\t-8614089537398948180 -> -8614089537398948180.0 [label=V id=\"-8614089537398948180.0.0\"]\n\t-8614089537398948180.1 [label=Integer]\n\t-8614089537398948180 -> -8614089537398948180.1 [label=U id=\"-8614089537398948180.1.1\"]\n\t-8614089537398948180.2 [label=Integer]\n\t-8614089537398948180 -> -8614089537398948180.2 [label=T id=\"-8614089537398948180.2.2\"]\n}",
         "label": null,
         "rule": "metadsl_core.function.FunctionTwo.from_fn"
        },
        {
         "graph": "digraph {\n\tnode [shape=plain]\n\tedge [arrowsize=0.5 penwidth=0.5]\n\t8630295114445134855 [label=\"FunctionTwo.create\" id=6626111992951741011]\n\t8630295114445134855 -> -2626880919931084916 [id=\"6626111992951741011.args[0]\"]\n\t-2626880919931084916 [label=\"'add'\" id=-2626880919931084916]\n\t8630295114445134855 -> 5106739603382598765 [id=\"6626111992951741011.args[1]\"]\n\t5106739603382598765 [label=\"Abstraction.create\" id=-7803251851758211739]\n\t5106739603382598765 -> -4485477713160206705 [id=\"-7803251851758211739.args[0]\"]\n\t-4485477713160206705 [label=\"Abstraction.create_variable\" id=-4485477713160206705]\n\t-4485477713160206705 -> -5085883562703833547 [id=\"-4485477713160206705.args[0]\"]\n\t-5085883562703833547 [label=\"Variable(4660943000)\" id=-5085883562703833547]\n\t-4485477713160206705.0 [label=Abstraction]\n\t\"-4485477713160206705.0.0\" [label=Integer]\n\t-4485477713160206705.0 -> \"-4485477713160206705.0.0\" [label=U id=\"-4485477713160206705.0.0\"]\n\t\"-4485477713160206705.0.1\" [label=Integer]\n\t-4485477713160206705.0 -> \"-4485477713160206705.0.1\" [label=T id=\"-4485477713160206705.0.1\"]\n\t-4485477713160206705 -> -4485477713160206705.0 [label=U id=\"-4485477713160206705.0.0\"]\n\t-4485477713160206705.1 [label=Integer]\n\t-4485477713160206705 -> -4485477713160206705.1 [label=T id=\"-4485477713160206705.1.1\"]\n\t5106739603382598765 -> -2601574970510395267 [id=\"-7803251851758211739.args[1]\"]\n\t-2601574970510395267 [label=\"Abstraction.from_fn\" id=-2601574970510395267]\n\t-2601574970510395267 -> 4117663596895676661 [id=\"-2601574970510395267.args[0]\"]\n\t4117663596895676661 [label=\"FunctionReplaceTyping(fn=function FunctionTwo.from_fn.locals.inner.locals.inner_inner at 0x115cfbbf8, typevars={~T: class 'metadsl_core.integer.Integer', ~U: metadsl_core.abstraction.Abstraction[metadsl_core.integer.Integer, metadsl_core.integer.Integer]}, inner_mapping=function replace_typevars_expression.locals.lambda at 0x115ccef28)\" id=4117663596895676661]\n\t5106739603382598765.0 [label=Abstraction]\n\t\"5106739603382598765.0.0\" [label=Integer]\n\t5106739603382598765.0 -> \"5106739603382598765.0.0\" [label=U id=\"5106739603382598765.0.0\"]\n\t\"5106739603382598765.0.1\" [label=Integer]\n\t5106739603382598765.0 -> \"5106739603382598765.0.1\" [label=T id=\"5106739603382598765.0.1\"]\n\t5106739603382598765 -> 5106739603382598765.0 [label=U id=\"5106739603382598765.0.0\"]\n\t5106739603382598765.1 [label=Integer]\n\t5106739603382598765 -> 5106739603382598765.1 [label=T id=\"5106739603382598765.1.1\"]\n\t8630295114445134855.0 [label=Integer]\n\t8630295114445134855 -> 8630295114445134855.0 [label=V id=\"8630295114445134855.0.0\"]\n\t8630295114445134855.1 [label=Integer]\n\t8630295114445134855 -> 8630295114445134855.1 [label=U id=\"8630295114445134855.1.1\"]\n\t8630295114445134855.2 [label=Integer]\n\t8630295114445134855 -> 8630295114445134855.2 [label=T id=\"8630295114445134855.2.2\"]\n}",
         "label": null,
         "rule": "metadsl_core.abstraction.Abstraction.from_fn"
        },
        {
         "graph": "digraph {\n\tnode [shape=plain]\n\tedge [arrowsize=0.5 penwidth=0.5]\n\t-8543162192516159022 [label=\"FunctionTwo.create\" id=6626111992951741011]\n\t-8543162192516159022 -> -2626880919931084916 [id=\"6626111992951741011.args[0]\"]\n\t-2626880919931084916 [label=\"'add'\" id=-2626880919931084916]\n\t-8543162192516159022 -> -5537016880100348786 [id=\"6626111992951741011.args[1]\"]\n\t-5537016880100348786 [label=\"Abstraction.create\" id=-7803251851758211739]\n\t-5537016880100348786 -> -4485477713160206705 [id=\"-7803251851758211739.args[0]\"]\n\t-4485477713160206705 [label=\"Abstraction.create_variable\" id=-4485477713160206705]\n\t-4485477713160206705 -> -5085883562703833547 [id=\"-4485477713160206705.args[0]\"]\n\t-5085883562703833547 [label=\"Variable(4660943000)\" id=-5085883562703833547]\n\t-4485477713160206705.0 [label=Abstraction]\n\t\"-4485477713160206705.0.0\" [label=Integer]\n\t-4485477713160206705.0 -> \"-4485477713160206705.0.0\" [label=U id=\"-4485477713160206705.0.0\"]\n\t\"-4485477713160206705.0.1\" [label=Integer]\n\t-4485477713160206705.0 -> \"-4485477713160206705.0.1\" [label=T id=\"-4485477713160206705.0.1\"]\n\t-4485477713160206705 -> -4485477713160206705.0 [label=U id=\"-4485477713160206705.0.0\"]\n\t-4485477713160206705.1 [label=Integer]\n\t-4485477713160206705 -> -4485477713160206705.1 [label=T id=\"-4485477713160206705.1.1\"]\n\t-5537016880100348786 -> -8505639159044087460 [id=\"-7803251851758211739.args[1]\"]\n\t-8505639159044087460 [label=\"Abstraction.create\" id=-2601574970510395267]\n\t-8505639159044087460 -> -5875961188073735461 [id=\"-2601574970510395267.args[0]\"]\n\t-5875961188073735461 [label=\"Abstraction.create_variable\" id=-5875961188073735461]\n\t-5875961188073735461 -> 4137483036310687436 [id=\"-5875961188073735461.args[0]\"]\n\t4137483036310687436 [label=\"Variable(4580951264)\" id=4137483036310687436]\n\t-5875961188073735461.0 [label=\"~V\" id=-5875961188073735461.0]\n\t-5875961188073735461 -> -5875961188073735461.0 [label=U id=\"-5875961188073735461.0.0\"]\n\t-5875961188073735461.1 [label=\"~U\" id=-5875961188073735461.1]\n\t-5875961188073735461 -> -5875961188073735461.1 [label=T id=\"-5875961188073735461.1.1\"]\n\t-8505639159044087460 -> -20600624907915588 [id=\"-2601574970510395267.args[1]\"]\n\t-20600624907915588 [label=\"Integer.__add__\" id=-20600624907915588]\n\t-20600624907915588 -> -4485477713160206705 [id=\"-20600624907915588.args[0]\"]\n\t-20600624907915588 -> -5875961188073735461 [id=\"-20600624907915588.args[1]\"]\n\t-8505639159044087460.0 [label=\"~V\" id=-8505639159044087460.0]\n\t-8505639159044087460 -> -8505639159044087460.0 [label=U id=\"-8505639159044087460.0.0\"]\n\t-8505639159044087460.1 [label=\"~U\" id=-8505639159044087460.1]\n\t-8505639159044087460 -> -8505639159044087460.1 [label=T id=\"-8505639159044087460.1.1\"]\n\t-5537016880100348786.0 [label=Abstraction]\n\t\"-5537016880100348786.0.0\" [label=Integer]\n\t-5537016880100348786.0 -> \"-5537016880100348786.0.0\" [label=U id=\"-5537016880100348786.0.0\"]\n\t\"-5537016880100348786.0.1\" [label=Integer]\n\t-5537016880100348786.0 -> \"-5537016880100348786.0.1\" [label=T id=\"-5537016880100348786.0.1\"]\n\t-5537016880100348786 -> -5537016880100348786.0 [label=U id=\"-5537016880100348786.0.0\"]\n\t-5537016880100348786.1 [label=Integer]\n\t-5537016880100348786 -> -5537016880100348786.1 [label=T id=\"-5537016880100348786.1.1\"]\n\t-8543162192516159022.0 [label=Integer]\n\t-8543162192516159022 -> -8543162192516159022.0 [label=V id=\"-8543162192516159022.0.0\"]\n\t-8543162192516159022.1 [label=Integer]\n\t-8543162192516159022 -> -8543162192516159022.1 [label=U id=\"-8543162192516159022.1.1\"]\n\t-8543162192516159022.2 [label=Integer]\n\t-8543162192516159022 -> -8543162192516159022.2 [label=T id=\"-8543162192516159022.2.2\"]\n}",
         "label": null,
         "rule": "metadsl_core.abstraction.Abstraction.from_fn"
        },
        {
         "graph": "digraph {\n\tnode [shape=plain]\n\tedge [arrowsize=0.5 penwidth=0.5]\n\t-8543162192516159022 [label=\"FunctionTwo.create\" id=6626111992951741011]\n\t-8543162192516159022 -> -2626880919931084916 [id=\"6626111992951741011.args[0]\"]\n\t-2626880919931084916 [label=\"'add'\" id=-2626880919931084916]\n\t-8543162192516159022 -> -5537016880100348786 [id=\"6626111992951741011.args[1]\"]\n\t-5537016880100348786 [label=\"Abstraction.create\" id=-7803251851758211739]\n\t-5537016880100348786 -> -4485477713160206705 [id=\"-7803251851758211739.args[0]\"]\n\t-4485477713160206705 [label=\"Abstraction.create_variable\" id=-4485477713160206705]\n\t-4485477713160206705 -> -5085883562703833547 [id=\"-4485477713160206705.args[0]\"]\n\t-5085883562703833547 [label=\"Variable(4660943000)\" id=-5085883562703833547]\n\t-4485477713160206705.0 [label=Abstraction]\n\t\"-4485477713160206705.0.0\" [label=Integer]\n\t-4485477713160206705.0 -> \"-4485477713160206705.0.0\" [label=U id=\"-4485477713160206705.0.0\"]\n\t\"-4485477713160206705.0.1\" [label=Integer]\n\t-4485477713160206705.0 -> \"-4485477713160206705.0.1\" [label=T id=\"-4485477713160206705.0.1\"]\n\t-4485477713160206705 -> -4485477713160206705.0 [label=U id=\"-4485477713160206705.0.0\"]\n\t-4485477713160206705.1 [label=Integer]\n\t-4485477713160206705 -> -4485477713160206705.1 [label=T id=\"-4485477713160206705.1.1\"]\n\t-5537016880100348786 -> -8505639159044087460 [id=\"-7803251851758211739.args[1]\"]\n\t-8505639159044087460 [label=\"Abstraction.create\" id=-2601574970510395267]\n\t-8505639159044087460 -> -5875961188073735461 [id=\"-2601574970510395267.args[0]\"]\n\t-5875961188073735461 [label=\"Abstraction.create_variable\" id=-5875961188073735461]\n\t-5875961188073735461 -> 4137483036310687436 [id=\"-5875961188073735461.args[0]\"]\n\t4137483036310687436 [label=\"Variable(4580951264)\" id=4137483036310687436]\n\t-5875961188073735461.0 [label=\"~V\" id=-5875961188073735461.0]\n\t-5875961188073735461 -> -5875961188073735461.0 [label=U id=\"-5875961188073735461.0.0\"]\n\t-5875961188073735461.1 [label=\"~U\" id=-5875961188073735461.1]\n\t-5875961188073735461 -> -5875961188073735461.1 [label=T id=\"-5875961188073735461.1.1\"]\n\t-8505639159044087460 -> -20600624907915588 [id=\"-2601574970510395267.args[1]\"]\n\t-20600624907915588 [label=\"Integer.__add__\" id=-20600624907915588]\n\t-20600624907915588 -> -4485477713160206705 [id=\"-20600624907915588.args[0]\"]\n\t-20600624907915588 -> -5875961188073735461 [id=\"-20600624907915588.args[1]\"]\n\t-8505639159044087460.0 [label=\"~V\" id=-8505639159044087460.0]\n\t-8505639159044087460 -> -8505639159044087460.0 [label=U id=\"-8505639159044087460.0.0\"]\n\t-8505639159044087460.1 [label=\"~U\" id=-8505639159044087460.1]\n\t-8505639159044087460 -> -8505639159044087460.1 [label=T id=\"-8505639159044087460.1.1\"]\n\t-5537016880100348786.0 [label=Abstraction]\n\t\"-5537016880100348786.0.0\" [label=Integer]\n\t-5537016880100348786.0 -> \"-5537016880100348786.0.0\" [label=U id=\"-5537016880100348786.0.0\"]\n\t\"-5537016880100348786.0.1\" [label=Integer]\n\t-5537016880100348786.0 -> \"-5537016880100348786.0.1\" [label=T id=\"-5537016880100348786.0.1\"]\n\t-5537016880100348786 -> -5537016880100348786.0 [label=U id=\"-5537016880100348786.0.0\"]\n\t-5537016880100348786.1 [label=Integer]\n\t-5537016880100348786 -> -5537016880100348786.1 [label=T id=\"-5537016880100348786.1.1\"]\n\t-8543162192516159022.0 [label=Integer]\n\t-8543162192516159022 -> -8543162192516159022.0 [label=V id=\"-8543162192516159022.0.0\"]\n\t-8543162192516159022.1 [label=Integer]\n\t-8543162192516159022 -> -8543162192516159022.1 [label=U id=\"-8543162192516159022.1.1\"]\n\t-8543162192516159022.2 [label=Integer]\n\t-8543162192516159022 -> -8543162192516159022.2 [label=T id=\"-8543162192516159022.2.2\"]\n}",
         "label": "core",
         "rule": ""
        }
       ]
      },
      "text/plain": [
       "Typez(definitions=None, nodes={'1420165815779654667': ['1420165815779654667', PrimitiveNode(type='function', repr='<function add at 0x115cc9d90>')], '6626111992951741011': ['6626111992951741011', CallNode(function='FunctionTwo.from_fn', type_params=None, args=['1420165815779654667'], kwargs=None)], '-2626880919931084916': ['-2626880919931084916', PrimitiveNode(type='str', repr=\"'add'\")], '4117663685757988861': ['4117663685757988861', PrimitiveNode(type='FunctionReplaceTyping', repr=\"FunctionReplaceTyping(fn=<function FunctionTwo.from_fn.<locals>.inner at 0x115cfb048>, typevars={~U: <class 'metadsl_core.integer.Integer'>, ~T: <class 'metadsl_core.integer.Integer'>, ~V: <class 'metadsl_core.integer.Integer'>}, inner_mapping=<function replace_typevars_expression.<locals>.<lambda> at 0x115ccec80>)\")], '-7803251851758211739': ['-7803251851758211739', CallNode(function='Abstraction.from_fn', type_params=None, args=['4117663685757988861'], kwargs=None)], '-8614089537398948180': ['6626111992951741011', CallNode(function='FunctionTwo.create', type_params={'V': DeclaredTypeInstance(type='Integer', params=None), 'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['-2626880919931084916', '-7803251851758211739'], kwargs=None)], '-5085883562703833547': ['-5085883562703833547', PrimitiveNode(type='Variable', repr='Variable(4660943000)')], '-4485477713160206705': ['-4485477713160206705', CallNode(function='Abstraction.create_variable', type_params={'U': DeclaredTypeInstance(type='Abstraction', params={'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['-5085883562703833547'], kwargs=None)], '4117663596895676661': ['4117663596895676661', PrimitiveNode(type='FunctionReplaceTyping', repr=\"FunctionReplaceTyping(fn=<function FunctionTwo.from_fn.<locals>.inner.<locals>.inner_inner at 0x115cfbbf8>, typevars={~T: <class 'metadsl_core.integer.Integer'>, ~U: metadsl_core.abstraction.Abstraction[metadsl_core.integer.Integer, metadsl_core.integer.Integer]}, inner_mapping=<function replace_typevars_expression.<locals>.<lambda> at 0x115ccef28>)\")], '-2601574970510395267': ['-2601574970510395267', CallNode(function='Abstraction.from_fn', type_params=None, args=['4117663596895676661'], kwargs=None)], '5106739603382598765': ['-7803251851758211739', CallNode(function='Abstraction.create', type_params={'U': DeclaredTypeInstance(type='Abstraction', params={'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['-4485477713160206705', '-2601574970510395267'], kwargs=None)], '8630295114445134855': ['6626111992951741011', CallNode(function='FunctionTwo.create', type_params={'V': DeclaredTypeInstance(type='Integer', params=None), 'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['-2626880919931084916', '5106739603382598765'], kwargs=None)], '4137483036310687436': ['4137483036310687436', PrimitiveNode(type='Variable', repr='Variable(4580951264)')], '-5875961188073735461': ['-5875961188073735461', CallNode(function='Abstraction.create_variable', type_params={'U': ExternalTypeInstance(repr='~V'), 'T': ExternalTypeInstance(repr='~U')}, args=['4137483036310687436'], kwargs=None)], '-20600624907915588': ['-20600624907915588', CallNode(function='Integer.__add__', type_params=None, args=['-4485477713160206705', '-5875961188073735461'], kwargs=None)], '-8505639159044087460': ['-2601574970510395267', CallNode(function='Abstraction.create', type_params={'U': ExternalTypeInstance(repr='~V'), 'T': ExternalTypeInstance(repr='~U')}, args=['-5875961188073735461', '-20600624907915588'], kwargs=None)], '-5537016880100348786': ['-7803251851758211739', CallNode(function='Abstraction.create', type_params={'U': DeclaredTypeInstance(type='Abstraction', params={'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['-4485477713160206705', '-8505639159044087460'], kwargs=None)], '-8543162192516159022': ['6626111992951741011', CallNode(function='FunctionTwo.create', type_params={'V': DeclaredTypeInstance(type='Integer', params=None), 'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['-2626880919931084916', '-5537016880100348786'], kwargs=None)]}, states=States(initial='6626111992951741011', states=[State(node='-8614089537398948180', rule='metadsl_core.function.FunctionTwo.from_fn', label=None), State(node='8630295114445134855', rule='metadsl_core.abstraction.Abstraction.from_fn', label=None), State(node='-8543162192516159022', rule='metadsl_core.abstraction.Abstraction.from_fn', label=None), State(node='-8543162192516159022', rule='', label='core')]))"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "entring scope <function Abstraction.from_fn at 0x11118c048>\n",
      "done\n",
      "entring scope <function FunctionTwo.create at 0x115872f28>\n",
      "done\n",
      "getting typevars <function FunctionTwo.from_fn.<locals>.inner at 0x115cfb048> {~U: <class 'metadsl_core.integer.Integer'>, ~T: <class 'metadsl_core.integer.Integer'>, ~V: <class 'metadsl_core.integer.Integer'>}\n",
      "entring scope <function Abstraction.create_variable at 0x11118c0d0>\n",
      "done\n",
      "entring scope <function Abstraction.from_fn at 0x11118c048>\n",
      "done\n",
      "getting typevars <function FunctionTwo.from_fn.<locals>.inner.<locals>.inner_inner at 0x115cfbbf8> {}\n",
      "entring scope <function Abstraction.create at 0x11117bea0>\n",
      "done\n",
      "getting typevars <function FunctionTwo.from_fn.<locals>.inner.<locals>.inner_inner at 0x115cfbbf8> {~T: <class 'metadsl_core.integer.Integer'>, ~U: metadsl_core.abstraction.Abstraction[metadsl_core.integer.Integer, metadsl_core.integer.Integer]}\n",
      "entring scope <function Abstraction.create_variable at 0x11118c0d0>\n",
      "done\n",
      "entring scope <function Integer.__add__ at 0x1111aa7b8>\n",
      "done\n",
      "entring scope <function Abstraction.create at 0x11117bea0>\n",
      "done\n"
     ]
    }
   ],
   "source": [
    "add"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "entring scope <function Integer.from_int at 0x1111aaea0>\n",
      "done\n",
      "entring scope <function Integer.from_int at 0x1111aaea0>\n",
      "done\n",
      "entring scope <function FunctionTwo.__call__ at 0x115872ea0>\n",
      "done\n"
     ]
    }
   ],
   "source": [
    "res = add(Integer.from_int(1), Integer.from_int(1))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "entring scope <function FunctionTwo.from_fn at 0x115872c80>\n",
      "done\n",
      "entring scope <function Integer.from_int at 0x1111aaea0>\n",
      "done\n",
      "entring scope <function Integer.from_int at 0x1111aaea0>\n",
      "done\n",
      "entring scope <function FunctionTwo.__call__ at 0x115872ea0>\n",
      "done\n"
     ]
    },
    {
     "data": {
      "application/json": {
       "nodes": {
        "-1224448140870306284": [
         "-8780721530241323099",
         {
          "args": [
           "8309987831354380420",
           "5952552831974933580"
          ],
          "function": "Abstraction.create",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "type": "Integer"
           }
          }
         }
        ],
        "-1854422537929804929": [
         "-1854422537929804929",
         {
          "args": [
           "8309987831354380420",
           "-1975394213187693597"
          ],
          "function": "Abstraction.create",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "type": "Integer"
           }
          }
         }
        ],
        "-1975394213187693597": [
         "-1975394213187693597",
         {
          "args": [
           "4242784867114875566",
           "8309987831354380420"
          ],
          "function": "Integer.__add__"
         }
        ],
        "-2626880919931084916": [
         "-2626880919931084916",
         {
          "repr": "'add'",
          "type": "str"
         }
        ],
        "-3475606022767182024": [
         "-3475606022767182024",
         {
          "args": [
           "4137488412078958761"
          ],
          "function": "Abstraction.create_variable",
          "type_params": {
           "T": {
            "repr": "~U"
           },
           "U": {
            "repr": "~V"
           }
          }
         }
        ],
        "-3527129283339876993": [
         "-8200051156713058395",
         {
          "args": [
           "4242784867114875566",
           "7042612948061698794"
          ],
          "function": "Abstraction.create",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "params": {
             "T": {
              "type": "Integer"
             },
             "U": {
              "type": "Integer"
             }
            },
            "type": "Abstraction"
           }
          }
         }
        ],
        "-4018810008853743222": [
         "-5193555912603863371",
         {
          "args": [
           "-7189304769722504649",
           "-5403641055608078594"
          ],
          "function": "Abstraction.__call__",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "type": "Integer"
           }
          }
         }
        ],
        "-4744208650310199047": [
         "-8318583875699831496",
         {
          "args": [
           "4242784867114875566",
           "-1854422537929804929"
          ],
          "function": "Abstraction.create",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "params": {
             "T": {
              "type": "Integer"
             },
             "U": {
              "type": "Integer"
             }
            },
            "type": "Abstraction"
           }
          }
         }
        ],
        "-5085883624573384872": [
         "-5085883624573384872",
         {
          "repr": "Variable(4660810920)",
          "type": "Variable"
         }
        ],
        "-5193555912603863371": [
         "-5193555912603863371",
         {
          "args": [
           "6626111992951741011",
           "-5403641055608078594",
           "-5403641055608078594"
          ],
          "function": "FunctionTwo.__call__",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "type": "Integer"
           },
           "V": {
            "type": "Integer"
           }
          }
         }
        ],
        "-5403641055608078594": [
         "-5403641055608078594",
         {
          "args": [
           "-7790802924074436816"
          ],
          "function": "Integer.from_int"
         }
        ],
        "-621304054306896899": [
         "-5193555912603863371",
         {
          "args": [
           "-7790802924073354291"
          ],
          "function": "Integer.from_int"
         }
        ],
        "-7189304769722504649": [
         "-8780721530241323099",
         {
          "args": [
           "-4744208650310199047",
           "-5403641055608078594"
          ],
          "function": "Abstraction.__call__",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "params": {
             "T": {
              "type": "Integer"
             },
             "U": {
              "type": "Integer"
             }
            },
            "type": "Abstraction"
           }
          }
         }
        ],
        "-7790802924073354291": [
         "-7790802924073354291",
         {
          "repr": "2",
          "type": "int"
         }
        ],
        "-7790802924074436816": [
         "-7790802924074436816",
         {
          "repr": "1",
          "type": "int"
         }
        ],
        "-8200051156713058395": [
         "-8200051156713058395",
         {
          "args": [
           "4117663849193283261"
          ],
          "function": "Abstraction.from_fn"
         }
        ],
        "-8273268554068208387": [
         "-5193555912603863371",
         {
          "args": [
           "3961087283244096236",
           "-5403641055608078594",
           "-5403641055608078594"
          ],
          "function": "FunctionTwo.__call__",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "type": "Integer"
           },
           "V": {
            "type": "Integer"
           }
          }
         }
        ],
        "-8318583875699831496": [
         "-8318583875699831496",
         {
          "args": [
           "2012822640849995423"
          ],
          "function": "FunctionTwo.abstraction",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "type": "Integer"
           },
           "V": {
            "type": "Integer"
           }
          }
         }
        ],
        "-8780721530241323099": [
         "-8780721530241323099",
         {
          "args": [
           "-8318583875699831496",
           "-5403641055608078594"
          ],
          "function": "Abstraction.__call__",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "params": {
             "T": {
              "type": "Integer"
             },
             "U": {
              "type": "Integer"
             }
            },
            "type": "Abstraction"
           }
          }
         }
        ],
        "-8899406230380256572": [
         "-5193555912603863371",
         {
          "args": [
           "-8780721530241323099",
           "-5403641055608078594"
          ],
          "function": "Abstraction.__call__",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "type": "Integer"
           }
          }
         }
        ],
        "1420165815779654667": [
         "1420165815779654667",
         {
          "repr": "<function add at 0x115cc9d90>",
          "type": "function"
         }
        ],
        "1780721323272362984": [
         "-8200051156713058395",
         {
          "args": [
           "4242784867114875566",
           "7795011545938384549"
          ],
          "function": "Abstraction.create",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "params": {
             "T": {
              "type": "Integer"
             },
             "U": {
              "type": "Integer"
             }
            },
            "type": "Abstraction"
           }
          }
         }
        ],
        "2012822640849995423": [
         "2012822640849995423",
         {
          "args": [
           "-2626880919931084916",
           "-4744208650310199047"
          ],
          "function": "FunctionTwo.create",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "type": "Integer"
           },
           "V": {
            "type": "Integer"
           }
          }
         }
        ],
        "2138260427683909128": [
         "6626111992951741011",
         {
          "args": [
           "-2626880919931084916",
           "-3527129283339876993"
          ],
          "function": "FunctionTwo.create",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "type": "Integer"
           },
           "V": {
            "type": "Integer"
           }
          }
         }
        ],
        "2637556855883507795": [
         "2637556855883507795",
         {
          "args": [
           "4242784867114875566",
           "-3475606022767182024"
          ],
          "function": "Integer.__add__"
         }
        ],
        "3080290470961596757": [
         "-5193555912603863371",
         {
          "args": [
           "-5403641055608078594",
           "-5403641055608078594"
          ],
          "function": "Integer.__add__"
         }
        ],
        "3961087283244096236": [
         "6626111992951741011",
         {
          "args": [
           "-2626880919931084916",
           "-8200051156713058395"
          ],
          "function": "FunctionTwo.create",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "type": "Integer"
           },
           "V": {
            "type": "Integer"
           }
          }
         }
        ],
        "4016958901431624490": [
         "-5193555912603863371",
         {
          "args": [
           "-1224448140870306284",
           "-5403641055608078594"
          ],
          "function": "Abstraction.__call__",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "type": "Integer"
           }
          }
         }
        ],
        "4117663849193283261": [
         "4117663849193283261",
         {
          "repr": "FunctionReplaceTyping(fn=<function FunctionTwo.from_fn.<locals>.inner at 0x115cc9f28>, typevars={~U: <class 'metadsl_core.integer.Integer'>, ~T: <class 'metadsl_core.integer.Integer'>, ~V: <class 'metadsl_core.integer.Integer'>}, inner_mapping=<function replace_typevars_expression.<locals>.<lambda> at 0x115cce730>)",
          "type": "FunctionReplaceTyping"
         }
        ],
        "4117663944247638461": [
         "4117663944247638461",
         {
          "repr": "FunctionReplaceTyping(fn=<function FunctionTwo.from_fn.<locals>.inner.<locals>.inner_inner at 0x115cce2f0>, typevars={~T: <class 'metadsl_core.integer.Integer'>, ~U: metadsl_core.abstraction.Abstraction[metadsl_core.integer.Integer, metadsl_core.integer.Integer]}, inner_mapping=<function replace_typevars_expression.<locals>.<lambda> at 0x115cf7400>)",
          "type": "FunctionReplaceTyping"
         }
        ],
        "4137488412078958761": [
         "4137488412078958761",
         {
          "repr": "Variable(4660811984)",
          "type": "Variable"
         }
        ],
        "4242784867114875566": [
         "4242784867114875566",
         {
          "args": [
           "-5085883624573384872"
          ],
          "function": "Abstraction.create_variable",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "params": {
             "T": {
              "type": "Integer"
             },
             "U": {
              "type": "Integer"
             }
            },
            "type": "Abstraction"
           }
          }
         }
        ],
        "5952552831974933580": [
         "5952552831974933580",
         {
          "args": [
           "-5403641055608078594",
           "8309987831354380420"
          ],
          "function": "Integer.__add__"
         }
        ],
        "6626111992951741011": [
         "6626111992951741011",
         {
          "args": [
           "1420165815779654667"
          ],
          "function": "FunctionTwo.from_fn"
         }
        ],
        "694123181974341849": [
         "-5193555912603863371",
         {
          "args": [
           "7620195834425458302",
           "-5403641055608078594",
           "-5403641055608078594"
          ],
          "function": "FunctionTwo.__call__",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "type": "Integer"
           },
           "V": {
            "type": "Integer"
           }
          }
         }
        ],
        "7042612948061698794": [
         "7795011545938384549",
         {
          "args": [
           "-3475606022767182024",
           "2637556855883507795"
          ],
          "function": "Abstraction.create",
          "type_params": {
           "T": {
            "repr": "~U"
           },
           "U": {
            "repr": "~V"
           }
          }
         }
        ],
        "7485432333345578442": [
         "-5193555912603863371",
         {
          "args": [
           "2138260427683909128",
           "-5403641055608078594",
           "-5403641055608078594"
          ],
          "function": "FunctionTwo.__call__",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "type": "Integer"
           },
           "V": {
            "type": "Integer"
           }
          }
         }
        ],
        "7620195834425458302": [
         "6626111992951741011",
         {
          "args": [
           "-2626880919931084916",
           "1780721323272362984"
          ],
          "function": "FunctionTwo.create",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "type": "Integer"
           },
           "V": {
            "type": "Integer"
           }
          }
         }
        ],
        "7795011545938384549": [
         "7795011545938384549",
         {
          "args": [
           "4117663944247638461"
          ],
          "function": "Abstraction.from_fn"
         }
        ],
        "8309987831354380420": [
         "8309987831354380420",
         {
          "args": [
           "4137488412078958761"
          ],
          "function": "Abstraction.create_variable",
          "type_params": {
           "T": {
            "type": "Integer"
           },
           "U": {
            "type": "Integer"
           }
          }
         }
        ]
       },
       "states": {
        "initial": "-5193555912603863371",
        "states": [
         {
          "node": "-8273268554068208387",
          "rule": "metadsl_core.function.FunctionTwo.from_fn"
         },
         {
          "node": "694123181974341849",
          "rule": "metadsl_core.abstraction.Abstraction.from_fn"
         },
         {
          "node": "7485432333345578442",
          "rule": "metadsl_core.abstraction.Abstraction.from_fn"
         },
         {
          "node": "-8899406230380256572",
          "rule": "metadsl_core.function.two_call"
         },
         {
          "node": "-4018810008853743222",
          "rule": "metadsl_core.function.two_abstraction"
         },
         {
          "node": "4016958901431624490",
          "rule": "metadsl_core.abstraction.beta_reduce"
         },
         {
          "node": "3080290470961596757",
          "rule": "metadsl_core.abstraction.beta_reduce"
         },
         {
          "node": "-621304054306896899",
          "rule": "metadsl_core.integer.integer_math"
         },
         {
          "label": "core",
          "node": "-621304054306896899",
          "rule": ""
         }
        ]
       }
      },
      "application/x.typez.graph+json": {
       "initial": "digraph {\n\tnode [shape=plain]\n\tedge [arrowsize=0.5 penwidth=0.5]\n\t-5193555912603863371 [label=\"FunctionTwo.__call__\" id=-5193555912603863371]\n\t-5193555912603863371 -> 6626111992951741011 [id=\"-5193555912603863371.args[0]\"]\n\t6626111992951741011 [label=\"FunctionTwo.from_fn\" id=6626111992951741011]\n\t6626111992951741011 -> 1420165815779654667 [id=\"6626111992951741011.args[0]\"]\n\t1420165815779654667 [label=\"function add at 0x115cc9d90\" id=1420165815779654667]\n\t-5193555912603863371 -> -5403641055608078594 [id=\"-5193555912603863371.args[1]\"]\n\t-5403641055608078594 [label=\"Integer.from_int\" id=-5403641055608078594]\n\t-5403641055608078594 -> -7790802924074436816 [id=\"-5403641055608078594.args[0]\"]\n\t-7790802924074436816 [label=1 id=-7790802924074436816]\n\t-5193555912603863371 -> -5403641055608078594 [id=\"-5193555912603863371.args[2]\"]\n\t-5193555912603863371.0 [label=Integer]\n\t-5193555912603863371 -> -5193555912603863371.0 [label=V id=\"-5193555912603863371.0.0\"]\n\t-5193555912603863371.1 [label=Integer]\n\t-5193555912603863371 -> -5193555912603863371.1 [label=U id=\"-5193555912603863371.1.1\"]\n\t-5193555912603863371.2 [label=Integer]\n\t-5193555912603863371 -> -5193555912603863371.2 [label=T id=\"-5193555912603863371.2.2\"]\n}",
       "states": [
        {
         "graph": "digraph {\n\tnode [shape=plain]\n\tedge [arrowsize=0.5 penwidth=0.5]\n\t-8273268554068208387 [label=\"FunctionTwo.__call__\" id=-5193555912603863371]\n\t-8273268554068208387 -> 3961087283244096236 [id=\"-5193555912603863371.args[0]\"]\n\t3961087283244096236 [label=\"FunctionTwo.create\" id=6626111992951741011]\n\t3961087283244096236 -> -2626880919931084916 [id=\"6626111992951741011.args[0]\"]\n\t-2626880919931084916 [label=\"'add'\" id=-2626880919931084916]\n\t3961087283244096236 -> -8200051156713058395 [id=\"6626111992951741011.args[1]\"]\n\t-8200051156713058395 [label=\"Abstraction.from_fn\" id=-8200051156713058395]\n\t-8200051156713058395 -> 4117663849193283261 [id=\"-8200051156713058395.args[0]\"]\n\t4117663849193283261 [label=\"FunctionReplaceTyping(fn=function FunctionTwo.from_fn.locals.inner at 0x115cc9f28, typevars={~U: class 'metadsl_core.integer.Integer', ~T: class 'metadsl_core.integer.Integer', ~V: class 'metadsl_core.integer.Integer'}, inner_mapping=function replace_typevars_expression.locals.lambda at 0x115cce730)\" id=4117663849193283261]\n\t3961087283244096236.0 [label=Integer]\n\t3961087283244096236 -> 3961087283244096236.0 [label=V id=\"3961087283244096236.0.0\"]\n\t3961087283244096236.1 [label=Integer]\n\t3961087283244096236 -> 3961087283244096236.1 [label=U id=\"3961087283244096236.1.1\"]\n\t3961087283244096236.2 [label=Integer]\n\t3961087283244096236 -> 3961087283244096236.2 [label=T id=\"3961087283244096236.2.2\"]\n\t-8273268554068208387 -> -5403641055608078594 [id=\"-5193555912603863371.args[1]\"]\n\t-5403641055608078594 [label=\"Integer.from_int\" id=-5403641055608078594]\n\t-5403641055608078594 -> -7790802924074436816 [id=\"-5403641055608078594.args[0]\"]\n\t-7790802924074436816 [label=1 id=-7790802924074436816]\n\t-8273268554068208387 -> -5403641055608078594 [id=\"-5193555912603863371.args[2]\"]\n\t-8273268554068208387.0 [label=Integer]\n\t-8273268554068208387 -> -8273268554068208387.0 [label=V id=\"-8273268554068208387.0.0\"]\n\t-8273268554068208387.1 [label=Integer]\n\t-8273268554068208387 -> -8273268554068208387.1 [label=U id=\"-8273268554068208387.1.1\"]\n\t-8273268554068208387.2 [label=Integer]\n\t-8273268554068208387 -> -8273268554068208387.2 [label=T id=\"-8273268554068208387.2.2\"]\n}",
         "label": null,
         "rule": "metadsl_core.function.FunctionTwo.from_fn"
        },
        {
         "graph": "digraph {\n\tnode [shape=plain]\n\tedge [arrowsize=0.5 penwidth=0.5]\n\t694123181974341849 [label=\"FunctionTwo.__call__\" id=-5193555912603863371]\n\t694123181974341849 -> 7620195834425458302 [id=\"-5193555912603863371.args[0]\"]\n\t7620195834425458302 [label=\"FunctionTwo.create\" id=6626111992951741011]\n\t7620195834425458302 -> -2626880919931084916 [id=\"6626111992951741011.args[0]\"]\n\t-2626880919931084916 [label=\"'add'\" id=-2626880919931084916]\n\t7620195834425458302 -> 1780721323272362984 [id=\"6626111992951741011.args[1]\"]\n\t1780721323272362984 [label=\"Abstraction.create\" id=-8200051156713058395]\n\t1780721323272362984 -> 4242784867114875566 [id=\"-8200051156713058395.args[0]\"]\n\t4242784867114875566 [label=\"Abstraction.create_variable\" id=4242784867114875566]\n\t4242784867114875566 -> -5085883624573384872 [id=\"4242784867114875566.args[0]\"]\n\t-5085883624573384872 [label=\"Variable(4660810920)\" id=-5085883624573384872]\n\t4242784867114875566.0 [label=Abstraction]\n\t\"4242784867114875566.0.0\" [label=Integer]\n\t4242784867114875566.0 -> \"4242784867114875566.0.0\" [label=U id=\"4242784867114875566.0.0\"]\n\t\"4242784867114875566.0.1\" [label=Integer]\n\t4242784867114875566.0 -> \"4242784867114875566.0.1\" [label=T id=\"4242784867114875566.0.1\"]\n\t4242784867114875566 -> 4242784867114875566.0 [label=U id=\"4242784867114875566.0.0\"]\n\t4242784867114875566.1 [label=Integer]\n\t4242784867114875566 -> 4242784867114875566.1 [label=T id=\"4242784867114875566.1.1\"]\n\t1780721323272362984 -> 7795011545938384549 [id=\"-8200051156713058395.args[1]\"]\n\t7795011545938384549 [label=\"Abstraction.from_fn\" id=7795011545938384549]\n\t7795011545938384549 -> 4117663944247638461 [id=\"7795011545938384549.args[0]\"]\n\t4117663944247638461 [label=\"FunctionReplaceTyping(fn=function FunctionTwo.from_fn.locals.inner.locals.inner_inner at 0x115cce2f0, typevars={~T: class 'metadsl_core.integer.Integer', ~U: metadsl_core.abstraction.Abstraction[metadsl_core.integer.Integer, metadsl_core.integer.Integer]}, inner_mapping=function replace_typevars_expression.locals.lambda at 0x115cf7400)\" id=4117663944247638461]\n\t1780721323272362984.0 [label=Abstraction]\n\t\"1780721323272362984.0.0\" [label=Integer]\n\t1780721323272362984.0 -> \"1780721323272362984.0.0\" [label=U id=\"1780721323272362984.0.0\"]\n\t\"1780721323272362984.0.1\" [label=Integer]\n\t1780721323272362984.0 -> \"1780721323272362984.0.1\" [label=T id=\"1780721323272362984.0.1\"]\n\t1780721323272362984 -> 1780721323272362984.0 [label=U id=\"1780721323272362984.0.0\"]\n\t1780721323272362984.1 [label=Integer]\n\t1780721323272362984 -> 1780721323272362984.1 [label=T id=\"1780721323272362984.1.1\"]\n\t7620195834425458302.0 [label=Integer]\n\t7620195834425458302 -> 7620195834425458302.0 [label=V id=\"7620195834425458302.0.0\"]\n\t7620195834425458302.1 [label=Integer]\n\t7620195834425458302 -> 7620195834425458302.1 [label=U id=\"7620195834425458302.1.1\"]\n\t7620195834425458302.2 [label=Integer]\n\t7620195834425458302 -> 7620195834425458302.2 [label=T id=\"7620195834425458302.2.2\"]\n\t694123181974341849 -> -5403641055608078594 [id=\"-5193555912603863371.args[1]\"]\n\t-5403641055608078594 [label=\"Integer.from_int\" id=-5403641055608078594]\n\t-5403641055608078594 -> -7790802924074436816 [id=\"-5403641055608078594.args[0]\"]\n\t-7790802924074436816 [label=1 id=-7790802924074436816]\n\t694123181974341849 -> -5403641055608078594 [id=\"-5193555912603863371.args[2]\"]\n\t694123181974341849.0 [label=Integer]\n\t694123181974341849 -> 694123181974341849.0 [label=V id=\"694123181974341849.0.0\"]\n\t694123181974341849.1 [label=Integer]\n\t694123181974341849 -> 694123181974341849.1 [label=U id=\"694123181974341849.1.1\"]\n\t694123181974341849.2 [label=Integer]\n\t694123181974341849 -> 694123181974341849.2 [label=T id=\"694123181974341849.2.2\"]\n}",
         "label": null,
         "rule": "metadsl_core.abstraction.Abstraction.from_fn"
        },
        {
         "graph": "digraph {\n\tnode [shape=plain]\n\tedge [arrowsize=0.5 penwidth=0.5]\n\t7485432333345578442 [label=\"FunctionTwo.__call__\" id=-5193555912603863371]\n\t7485432333345578442 -> 2138260427683909128 [id=\"-5193555912603863371.args[0]\"]\n\t2138260427683909128 [label=\"FunctionTwo.create\" id=6626111992951741011]\n\t2138260427683909128 -> -2626880919931084916 [id=\"6626111992951741011.args[0]\"]\n\t-2626880919931084916 [label=\"'add'\" id=-2626880919931084916]\n\t2138260427683909128 -> -3527129283339876993 [id=\"6626111992951741011.args[1]\"]\n\t-3527129283339876993 [label=\"Abstraction.create\" id=-8200051156713058395]\n\t-3527129283339876993 -> 4242784867114875566 [id=\"-8200051156713058395.args[0]\"]\n\t4242784867114875566 [label=\"Abstraction.create_variable\" id=4242784867114875566]\n\t4242784867114875566 -> -5085883624573384872 [id=\"4242784867114875566.args[0]\"]\n\t-5085883624573384872 [label=\"Variable(4660810920)\" id=-5085883624573384872]\n\t4242784867114875566.0 [label=Abstraction]\n\t\"4242784867114875566.0.0\" [label=Integer]\n\t4242784867114875566.0 -> \"4242784867114875566.0.0\" [label=U id=\"4242784867114875566.0.0\"]\n\t\"4242784867114875566.0.1\" [label=Integer]\n\t4242784867114875566.0 -> \"4242784867114875566.0.1\" [label=T id=\"4242784867114875566.0.1\"]\n\t4242784867114875566 -> 4242784867114875566.0 [label=U id=\"4242784867114875566.0.0\"]\n\t4242784867114875566.1 [label=Integer]\n\t4242784867114875566 -> 4242784867114875566.1 [label=T id=\"4242784867114875566.1.1\"]\n\t-3527129283339876993 -> 7042612948061698794 [id=\"-8200051156713058395.args[1]\"]\n\t7042612948061698794 [label=\"Abstraction.create\" id=7795011545938384549]\n\t7042612948061698794 -> -3475606022767182024 [id=\"7795011545938384549.args[0]\"]\n\t-3475606022767182024 [label=\"Abstraction.create_variable\" id=-3475606022767182024]\n\t-3475606022767182024 -> 4137488412078958761 [id=\"-3475606022767182024.args[0]\"]\n\t4137488412078958761 [label=\"Variable(4660811984)\" id=4137488412078958761]\n\t-3475606022767182024.0 [label=\"~V\" id=-3475606022767182024.0]\n\t-3475606022767182024 -> -3475606022767182024.0 [label=U id=\"-3475606022767182024.0.0\"]\n\t-3475606022767182024.1 [label=\"~U\" id=-3475606022767182024.1]\n\t-3475606022767182024 -> -3475606022767182024.1 [label=T id=\"-3475606022767182024.1.1\"]\n\t7042612948061698794 -> 2637556855883507795 [id=\"7795011545938384549.args[1]\"]\n\t2637556855883507795 [label=\"Integer.__add__\" id=2637556855883507795]\n\t2637556855883507795 -> 4242784867114875566 [id=\"2637556855883507795.args[0]\"]\n\t2637556855883507795 -> -3475606022767182024 [id=\"2637556855883507795.args[1]\"]\n\t7042612948061698794.0 [label=\"~V\" id=7042612948061698794.0]\n\t7042612948061698794 -> 7042612948061698794.0 [label=U id=\"7042612948061698794.0.0\"]\n\t7042612948061698794.1 [label=\"~U\" id=7042612948061698794.1]\n\t7042612948061698794 -> 7042612948061698794.1 [label=T id=\"7042612948061698794.1.1\"]\n\t-3527129283339876993.0 [label=Abstraction]\n\t\"-3527129283339876993.0.0\" [label=Integer]\n\t-3527129283339876993.0 -> \"-3527129283339876993.0.0\" [label=U id=\"-3527129283339876993.0.0\"]\n\t\"-3527129283339876993.0.1\" [label=Integer]\n\t-3527129283339876993.0 -> \"-3527129283339876993.0.1\" [label=T id=\"-3527129283339876993.0.1\"]\n\t-3527129283339876993 -> -3527129283339876993.0 [label=U id=\"-3527129283339876993.0.0\"]\n\t-3527129283339876993.1 [label=Integer]\n\t-3527129283339876993 -> -3527129283339876993.1 [label=T id=\"-3527129283339876993.1.1\"]\n\t2138260427683909128.0 [label=Integer]\n\t2138260427683909128 -> 2138260427683909128.0 [label=V id=\"2138260427683909128.0.0\"]\n\t2138260427683909128.1 [label=Integer]\n\t2138260427683909128 -> 2138260427683909128.1 [label=U id=\"2138260427683909128.1.1\"]\n\t2138260427683909128.2 [label=Integer]\n\t2138260427683909128 -> 2138260427683909128.2 [label=T id=\"2138260427683909128.2.2\"]\n\t7485432333345578442 -> -5403641055608078594 [id=\"-5193555912603863371.args[1]\"]\n\t-5403641055608078594 [label=\"Integer.from_int\" id=-5403641055608078594]\n\t-5403641055608078594 -> -7790802924074436816 [id=\"-5403641055608078594.args[0]\"]\n\t-7790802924074436816 [label=1 id=-7790802924074436816]\n\t7485432333345578442 -> -5403641055608078594 [id=\"-5193555912603863371.args[2]\"]\n\t7485432333345578442.0 [label=Integer]\n\t7485432333345578442 -> 7485432333345578442.0 [label=V id=\"7485432333345578442.0.0\"]\n\t7485432333345578442.1 [label=Integer]\n\t7485432333345578442 -> 7485432333345578442.1 [label=U id=\"7485432333345578442.1.1\"]\n\t7485432333345578442.2 [label=Integer]\n\t7485432333345578442 -> 7485432333345578442.2 [label=T id=\"7485432333345578442.2.2\"]\n}",
         "label": null,
         "rule": "metadsl_core.abstraction.Abstraction.from_fn"
        },
        {
         "graph": "digraph {\n\tnode [shape=plain]\n\tedge [arrowsize=0.5 penwidth=0.5]\n\t-8899406230380256572 [label=\"Abstraction.__call__\" id=-5193555912603863371]\n\t-8899406230380256572 -> -8780721530241323099 [id=\"-5193555912603863371.args[0]\"]\n\t-8780721530241323099 [label=\"Abstraction.__call__\" id=-8780721530241323099]\n\t-8780721530241323099 -> -8318583875699831496 [id=\"-8780721530241323099.args[0]\"]\n\t-8318583875699831496 [label=\"FunctionTwo.abstraction\" id=-8318583875699831496]\n\t-8318583875699831496 -> 2012822640849995423 [id=\"-8318583875699831496.args[0]\"]\n\t2012822640849995423 [label=\"FunctionTwo.create\" id=2012822640849995423]\n\t2012822640849995423 -> -2626880919931084916 [id=\"2012822640849995423.args[0]\"]\n\t-2626880919931084916 [label=\"'add'\" id=-2626880919931084916]\n\t2012822640849995423 -> -4744208650310199047 [id=\"2012822640849995423.args[1]\"]\n\t-4744208650310199047 [label=\"Abstraction.create\" id=-8318583875699831496]\n\t-4744208650310199047 -> 4242784867114875566 [id=\"-8318583875699831496.args[0]\"]\n\t4242784867114875566 [label=\"Abstraction.create_variable\" id=4242784867114875566]\n\t4242784867114875566 -> -5085883624573384872 [id=\"4242784867114875566.args[0]\"]\n\t-5085883624573384872 [label=\"Variable(4660810920)\" id=-5085883624573384872]\n\t4242784867114875566.0 [label=Abstraction]\n\t\"4242784867114875566.0.0\" [label=Integer]\n\t4242784867114875566.0 -> \"4242784867114875566.0.0\" [label=U id=\"4242784867114875566.0.0\"]\n\t\"4242784867114875566.0.1\" [label=Integer]\n\t4242784867114875566.0 -> \"4242784867114875566.0.1\" [label=T id=\"4242784867114875566.0.1\"]\n\t4242784867114875566 -> 4242784867114875566.0 [label=U id=\"4242784867114875566.0.0\"]\n\t4242784867114875566.1 [label=Integer]\n\t4242784867114875566 -> 4242784867114875566.1 [label=T id=\"4242784867114875566.1.1\"]\n\t-4744208650310199047 -> -1854422537929804929 [id=\"-8318583875699831496.args[1]\"]\n\t-1854422537929804929 [label=\"Abstraction.create\" id=-1854422537929804929]\n\t-1854422537929804929 -> 8309987831354380420 [id=\"-1854422537929804929.args[0]\"]\n\t8309987831354380420 [label=\"Abstraction.create_variable\" id=8309987831354380420]\n\t8309987831354380420 -> 4137488412078958761 [id=\"8309987831354380420.args[0]\"]\n\t4137488412078958761 [label=\"Variable(4660811984)\" id=4137488412078958761]\n\t8309987831354380420.0 [label=Integer]\n\t8309987831354380420 -> 8309987831354380420.0 [label=U id=\"8309987831354380420.0.0\"]\n\t8309987831354380420.1 [label=Integer]\n\t8309987831354380420 -> 8309987831354380420.1 [label=T id=\"8309987831354380420.1.1\"]\n\t-1854422537929804929 -> -1975394213187693597 [id=\"-1854422537929804929.args[1]\"]\n\t-1975394213187693597 [label=\"Integer.__add__\" id=-1975394213187693597]\n\t-1975394213187693597 -> 4242784867114875566 [id=\"-1975394213187693597.args[0]\"]\n\t-1975394213187693597 -> 8309987831354380420 [id=\"-1975394213187693597.args[1]\"]\n\t-1854422537929804929.0 [label=Integer]\n\t-1854422537929804929 -> -1854422537929804929.0 [label=U id=\"-1854422537929804929.0.0\"]\n\t-1854422537929804929.1 [label=Integer]\n\t-1854422537929804929 -> -1854422537929804929.1 [label=T id=\"-1854422537929804929.1.1\"]\n\t-4744208650310199047.0 [label=Abstraction]\n\t\"-4744208650310199047.0.0\" [label=Integer]\n\t-4744208650310199047.0 -> \"-4744208650310199047.0.0\" [label=U id=\"-4744208650310199047.0.0\"]\n\t\"-4744208650310199047.0.1\" [label=Integer]\n\t-4744208650310199047.0 -> \"-4744208650310199047.0.1\" [label=T id=\"-4744208650310199047.0.1\"]\n\t-4744208650310199047 -> -4744208650310199047.0 [label=U id=\"-4744208650310199047.0.0\"]\n\t-4744208650310199047.1 [label=Integer]\n\t-4744208650310199047 -> -4744208650310199047.1 [label=T id=\"-4744208650310199047.1.1\"]\n\t2012822640849995423.0 [label=Integer]\n\t2012822640849995423 -> 2012822640849995423.0 [label=V id=\"2012822640849995423.0.0\"]\n\t2012822640849995423.1 [label=Integer]\n\t2012822640849995423 -> 2012822640849995423.1 [label=U id=\"2012822640849995423.1.1\"]\n\t2012822640849995423.2 [label=Integer]\n\t2012822640849995423 -> 2012822640849995423.2 [label=T id=\"2012822640849995423.2.2\"]\n\t-8318583875699831496.0 [label=Integer]\n\t-8318583875699831496 -> -8318583875699831496.0 [label=V id=\"-8318583875699831496.0.0\"]\n\t-8318583875699831496.1 [label=Integer]\n\t-8318583875699831496 -> -8318583875699831496.1 [label=U id=\"-8318583875699831496.1.1\"]\n\t-8318583875699831496.2 [label=Integer]\n\t-8318583875699831496 -> -8318583875699831496.2 [label=T id=\"-8318583875699831496.2.2\"]\n\t-8780721530241323099 -> -5403641055608078594 [id=\"-8780721530241323099.args[1]\"]\n\t-5403641055608078594 [label=\"Integer.from_int\" id=-5403641055608078594]\n\t-5403641055608078594 -> -7790802924074436816 [id=\"-5403641055608078594.args[0]\"]\n\t-7790802924074436816 [label=1 id=-7790802924074436816]\n\t-8780721530241323099.0 [label=Abstraction]\n\t\"-8780721530241323099.0.0\" [label=Integer]\n\t-8780721530241323099.0 -> \"-8780721530241323099.0.0\" [label=U id=\"-8780721530241323099.0.0\"]\n\t\"-8780721530241323099.0.1\" [label=Integer]\n\t-8780721530241323099.0 -> \"-8780721530241323099.0.1\" [label=T id=\"-8780721530241323099.0.1\"]\n\t-8780721530241323099 -> -8780721530241323099.0 [label=U id=\"-8780721530241323099.0.0\"]\n\t-8780721530241323099.1 [label=Integer]\n\t-8780721530241323099 -> -8780721530241323099.1 [label=T id=\"-8780721530241323099.1.1\"]\n\t-8899406230380256572 -> -5403641055608078594 [id=\"-5193555912603863371.args[1]\"]\n\t-8899406230380256572.0 [label=Integer]\n\t-8899406230380256572 -> -8899406230380256572.0 [label=U id=\"-8899406230380256572.0.0\"]\n\t-8899406230380256572.1 [label=Integer]\n\t-8899406230380256572 -> -8899406230380256572.1 [label=T id=\"-8899406230380256572.1.1\"]\n}",
         "label": null,
         "rule": "metadsl_core.function.two_call"
        },
        {
         "graph": "digraph {\n\tnode [shape=plain]\n\tedge [arrowsize=0.5 penwidth=0.5]\n\t-4018810008853743222 [label=\"Abstraction.__call__\" id=-5193555912603863371]\n\t-4018810008853743222 -> -7189304769722504649 [id=\"-5193555912603863371.args[0]\"]\n\t-7189304769722504649 [label=\"Abstraction.__call__\" id=-8780721530241323099]\n\t-7189304769722504649 -> -4744208650310199047 [id=\"-8780721530241323099.args[0]\"]\n\t-4744208650310199047 [label=\"Abstraction.create\" id=-8318583875699831496]\n\t-4744208650310199047 -> 4242784867114875566 [id=\"-8318583875699831496.args[0]\"]\n\t4242784867114875566 [label=\"Abstraction.create_variable\" id=4242784867114875566]\n\t4242784867114875566 -> -5085883624573384872 [id=\"4242784867114875566.args[0]\"]\n\t-5085883624573384872 [label=\"Variable(4660810920)\" id=-5085883624573384872]\n\t4242784867114875566.0 [label=Abstraction]\n\t\"4242784867114875566.0.0\" [label=Integer]\n\t4242784867114875566.0 -> \"4242784867114875566.0.0\" [label=U id=\"4242784867114875566.0.0\"]\n\t\"4242784867114875566.0.1\" [label=Integer]\n\t4242784867114875566.0 -> \"4242784867114875566.0.1\" [label=T id=\"4242784867114875566.0.1\"]\n\t4242784867114875566 -> 4242784867114875566.0 [label=U id=\"4242784867114875566.0.0\"]\n\t4242784867114875566.1 [label=Integer]\n\t4242784867114875566 -> 4242784867114875566.1 [label=T id=\"4242784867114875566.1.1\"]\n\t-4744208650310199047 -> -1854422537929804929 [id=\"-8318583875699831496.args[1]\"]\n\t-1854422537929804929 [label=\"Abstraction.create\" id=-1854422537929804929]\n\t-1854422537929804929 -> 8309987831354380420 [id=\"-1854422537929804929.args[0]\"]\n\t8309987831354380420 [label=\"Abstraction.create_variable\" id=8309987831354380420]\n\t8309987831354380420 -> 4137488412078958761 [id=\"8309987831354380420.args[0]\"]\n\t4137488412078958761 [label=\"Variable(4660811984)\" id=4137488412078958761]\n\t8309987831354380420.0 [label=Integer]\n\t8309987831354380420 -> 8309987831354380420.0 [label=U id=\"8309987831354380420.0.0\"]\n\t8309987831354380420.1 [label=Integer]\n\t8309987831354380420 -> 8309987831354380420.1 [label=T id=\"8309987831354380420.1.1\"]\n\t-1854422537929804929 -> -1975394213187693597 [id=\"-1854422537929804929.args[1]\"]\n\t-1975394213187693597 [label=\"Integer.__add__\" id=-1975394213187693597]\n\t-1975394213187693597 -> 4242784867114875566 [id=\"-1975394213187693597.args[0]\"]\n\t-1975394213187693597 -> 8309987831354380420 [id=\"-1975394213187693597.args[1]\"]\n\t-1854422537929804929.0 [label=Integer]\n\t-1854422537929804929 -> -1854422537929804929.0 [label=U id=\"-1854422537929804929.0.0\"]\n\t-1854422537929804929.1 [label=Integer]\n\t-1854422537929804929 -> -1854422537929804929.1 [label=T id=\"-1854422537929804929.1.1\"]\n\t-4744208650310199047.0 [label=Abstraction]\n\t\"-4744208650310199047.0.0\" [label=Integer]\n\t-4744208650310199047.0 -> \"-4744208650310199047.0.0\" [label=U id=\"-4744208650310199047.0.0\"]\n\t\"-4744208650310199047.0.1\" [label=Integer]\n\t-4744208650310199047.0 -> \"-4744208650310199047.0.1\" [label=T id=\"-4744208650310199047.0.1\"]\n\t-4744208650310199047 -> -4744208650310199047.0 [label=U id=\"-4744208650310199047.0.0\"]\n\t-4744208650310199047.1 [label=Integer]\n\t-4744208650310199047 -> -4744208650310199047.1 [label=T id=\"-4744208650310199047.1.1\"]\n\t-7189304769722504649 -> -5403641055608078594 [id=\"-8780721530241323099.args[1]\"]\n\t-5403641055608078594 [label=\"Integer.from_int\" id=-5403641055608078594]\n\t-5403641055608078594 -> -7790802924074436816 [id=\"-5403641055608078594.args[0]\"]\n\t-7790802924074436816 [label=1 id=-7790802924074436816]\n\t-7189304769722504649.0 [label=Abstraction]\n\t\"-7189304769722504649.0.0\" [label=Integer]\n\t-7189304769722504649.0 -> \"-7189304769722504649.0.0\" [label=U id=\"-7189304769722504649.0.0\"]\n\t\"-7189304769722504649.0.1\" [label=Integer]\n\t-7189304769722504649.0 -> \"-7189304769722504649.0.1\" [label=T id=\"-7189304769722504649.0.1\"]\n\t-7189304769722504649 -> -7189304769722504649.0 [label=U id=\"-7189304769722504649.0.0\"]\n\t-7189304769722504649.1 [label=Integer]\n\t-7189304769722504649 -> -7189304769722504649.1 [label=T id=\"-7189304769722504649.1.1\"]\n\t-4018810008853743222 -> -5403641055608078594 [id=\"-5193555912603863371.args[1]\"]\n\t-4018810008853743222.0 [label=Integer]\n\t-4018810008853743222 -> -4018810008853743222.0 [label=U id=\"-4018810008853743222.0.0\"]\n\t-4018810008853743222.1 [label=Integer]\n\t-4018810008853743222 -> -4018810008853743222.1 [label=T id=\"-4018810008853743222.1.1\"]\n}",
         "label": null,
         "rule": "metadsl_core.function.two_abstraction"
        },
        {
         "graph": "digraph {\n\tnode [shape=plain]\n\tedge [arrowsize=0.5 penwidth=0.5]\n\t4016958901431624490 [label=\"Abstraction.__call__\" id=-5193555912603863371]\n\t4016958901431624490 -> -1224448140870306284 [id=\"-5193555912603863371.args[0]\"]\n\t-1224448140870306284 [label=\"Abstraction.create\" id=-8780721530241323099]\n\t-1224448140870306284 -> 8309987831354380420 [id=\"-8780721530241323099.args[0]\"]\n\t8309987831354380420 [label=\"Abstraction.create_variable\" id=8309987831354380420]\n\t8309987831354380420 -> 4137488412078958761 [id=\"8309987831354380420.args[0]\"]\n\t4137488412078958761 [label=\"Variable(4660811984)\" id=4137488412078958761]\n\t8309987831354380420.0 [label=Integer]\n\t8309987831354380420 -> 8309987831354380420.0 [label=U id=\"8309987831354380420.0.0\"]\n\t8309987831354380420.1 [label=Integer]\n\t8309987831354380420 -> 8309987831354380420.1 [label=T id=\"8309987831354380420.1.1\"]\n\t-1224448140870306284 -> 5952552831974933580 [id=\"-8780721530241323099.args[1]\"]\n\t5952552831974933580 [label=\"Integer.__add__\" id=5952552831974933580]\n\t5952552831974933580 -> -5403641055608078594 [id=\"5952552831974933580.args[0]\"]\n\t-5403641055608078594 [label=\"Integer.from_int\" id=-5403641055608078594]\n\t-5403641055608078594 -> -7790802924074436816 [id=\"-5403641055608078594.args[0]\"]\n\t-7790802924074436816 [label=1 id=-7790802924074436816]\n\t5952552831974933580 -> 8309987831354380420 [id=\"5952552831974933580.args[1]\"]\n\t-1224448140870306284.0 [label=Integer]\n\t-1224448140870306284 -> -1224448140870306284.0 [label=U id=\"-1224448140870306284.0.0\"]\n\t-1224448140870306284.1 [label=Integer]\n\t-1224448140870306284 -> -1224448140870306284.1 [label=T id=\"-1224448140870306284.1.1\"]\n\t4016958901431624490 -> -5403641055608078594 [id=\"-5193555912603863371.args[1]\"]\n\t4016958901431624490.0 [label=Integer]\n\t4016958901431624490 -> 4016958901431624490.0 [label=U id=\"4016958901431624490.0.0\"]\n\t4016958901431624490.1 [label=Integer]\n\t4016958901431624490 -> 4016958901431624490.1 [label=T id=\"4016958901431624490.1.1\"]\n}",
         "label": null,
         "rule": "metadsl_core.abstraction.beta_reduce"
        },
        {
         "graph": "digraph {\n\tnode [shape=plain]\n\tedge [arrowsize=0.5 penwidth=0.5]\n\t3080290470961596757 [label=\"Integer.__add__\" id=-5193555912603863371]\n\t3080290470961596757 -> -5403641055608078594 [id=\"-5193555912603863371.args[0]\"]\n\t-5403641055608078594 [label=\"Integer.from_int\" id=-5403641055608078594]\n\t-5403641055608078594 -> -7790802924074436816 [id=\"-5403641055608078594.args[0]\"]\n\t-7790802924074436816 [label=1 id=-7790802924074436816]\n\t3080290470961596757 -> -5403641055608078594 [id=\"-5193555912603863371.args[1]\"]\n}",
         "label": null,
         "rule": "metadsl_core.abstraction.beta_reduce"
        },
        {
         "graph": "digraph {\n\tnode [shape=plain]\n\tedge [arrowsize=0.5 penwidth=0.5]\n\t-621304054306896899 [label=\"Integer.from_int\" id=-5193555912603863371]\n\t-621304054306896899 -> -7790802924073354291 [id=\"-5193555912603863371.args[0]\"]\n\t-7790802924073354291 [label=2 id=-7790802924073354291]\n}",
         "label": null,
         "rule": "metadsl_core.integer.integer_math"
        },
        {
         "graph": "digraph {\n\tnode [shape=plain]\n\tedge [arrowsize=0.5 penwidth=0.5]\n\t-621304054306896899 [label=\"Integer.from_int\" id=-5193555912603863371]\n\t-621304054306896899 -> -7790802924073354291 [id=\"-5193555912603863371.args[0]\"]\n\t-7790802924073354291 [label=2 id=-7790802924073354291]\n}",
         "label": "core",
         "rule": ""
        }
       ]
      },
      "text/plain": [
       "Typez(definitions=None, nodes={'1420165815779654667': ['1420165815779654667', PrimitiveNode(type='function', repr='<function add at 0x115cc9d90>')], '6626111992951741011': ['6626111992951741011', CallNode(function='FunctionTwo.from_fn', type_params=None, args=['1420165815779654667'], kwargs=None)], '-7790802924074436816': ['-7790802924074436816', PrimitiveNode(type='int', repr='1')], '-5403641055608078594': ['-5403641055608078594', CallNode(function='Integer.from_int', type_params=None, args=['-7790802924074436816'], kwargs=None)], '-5193555912603863371': ['-5193555912603863371', CallNode(function='FunctionTwo.__call__', type_params={'V': DeclaredTypeInstance(type='Integer', params=None), 'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['6626111992951741011', '-5403641055608078594', '-5403641055608078594'], kwargs=None)], '-2626880919931084916': ['-2626880919931084916', PrimitiveNode(type='str', repr=\"'add'\")], '4117663849193283261': ['4117663849193283261', PrimitiveNode(type='FunctionReplaceTyping', repr=\"FunctionReplaceTyping(fn=<function FunctionTwo.from_fn.<locals>.inner at 0x115cc9f28>, typevars={~U: <class 'metadsl_core.integer.Integer'>, ~T: <class 'metadsl_core.integer.Integer'>, ~V: <class 'metadsl_core.integer.Integer'>}, inner_mapping=<function replace_typevars_expression.<locals>.<lambda> at 0x115cce730>)\")], '-8200051156713058395': ['-8200051156713058395', CallNode(function='Abstraction.from_fn', type_params=None, args=['4117663849193283261'], kwargs=None)], '3961087283244096236': ['6626111992951741011', CallNode(function='FunctionTwo.create', type_params={'V': DeclaredTypeInstance(type='Integer', params=None), 'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['-2626880919931084916', '-8200051156713058395'], kwargs=None)], '-8273268554068208387': ['-5193555912603863371', CallNode(function='FunctionTwo.__call__', type_params={'V': DeclaredTypeInstance(type='Integer', params=None), 'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['3961087283244096236', '-5403641055608078594', '-5403641055608078594'], kwargs=None)], '-5085883624573384872': ['-5085883624573384872', PrimitiveNode(type='Variable', repr='Variable(4660810920)')], '4242784867114875566': ['4242784867114875566', CallNode(function='Abstraction.create_variable', type_params={'U': DeclaredTypeInstance(type='Abstraction', params={'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['-5085883624573384872'], kwargs=None)], '4117663944247638461': ['4117663944247638461', PrimitiveNode(type='FunctionReplaceTyping', repr=\"FunctionReplaceTyping(fn=<function FunctionTwo.from_fn.<locals>.inner.<locals>.inner_inner at 0x115cce2f0>, typevars={~T: <class 'metadsl_core.integer.Integer'>, ~U: metadsl_core.abstraction.Abstraction[metadsl_core.integer.Integer, metadsl_core.integer.Integer]}, inner_mapping=<function replace_typevars_expression.<locals>.<lambda> at 0x115cf7400>)\")], '7795011545938384549': ['7795011545938384549', CallNode(function='Abstraction.from_fn', type_params=None, args=['4117663944247638461'], kwargs=None)], '1780721323272362984': ['-8200051156713058395', CallNode(function='Abstraction.create', type_params={'U': DeclaredTypeInstance(type='Abstraction', params={'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['4242784867114875566', '7795011545938384549'], kwargs=None)], '7620195834425458302': ['6626111992951741011', CallNode(function='FunctionTwo.create', type_params={'V': DeclaredTypeInstance(type='Integer', params=None), 'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['-2626880919931084916', '1780721323272362984'], kwargs=None)], '694123181974341849': ['-5193555912603863371', CallNode(function='FunctionTwo.__call__', type_params={'V': DeclaredTypeInstance(type='Integer', params=None), 'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['7620195834425458302', '-5403641055608078594', '-5403641055608078594'], kwargs=None)], '4137488412078958761': ['4137488412078958761', PrimitiveNode(type='Variable', repr='Variable(4660811984)')], '-3475606022767182024': ['-3475606022767182024', CallNode(function='Abstraction.create_variable', type_params={'U': ExternalTypeInstance(repr='~V'), 'T': ExternalTypeInstance(repr='~U')}, args=['4137488412078958761'], kwargs=None)], '2637556855883507795': ['2637556855883507795', CallNode(function='Integer.__add__', type_params=None, args=['4242784867114875566', '-3475606022767182024'], kwargs=None)], '7042612948061698794': ['7795011545938384549', CallNode(function='Abstraction.create', type_params={'U': ExternalTypeInstance(repr='~V'), 'T': ExternalTypeInstance(repr='~U')}, args=['-3475606022767182024', '2637556855883507795'], kwargs=None)], '-3527129283339876993': ['-8200051156713058395', CallNode(function='Abstraction.create', type_params={'U': DeclaredTypeInstance(type='Abstraction', params={'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['4242784867114875566', '7042612948061698794'], kwargs=None)], '2138260427683909128': ['6626111992951741011', CallNode(function='FunctionTwo.create', type_params={'V': DeclaredTypeInstance(type='Integer', params=None), 'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['-2626880919931084916', '-3527129283339876993'], kwargs=None)], '7485432333345578442': ['-5193555912603863371', CallNode(function='FunctionTwo.__call__', type_params={'V': DeclaredTypeInstance(type='Integer', params=None), 'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['2138260427683909128', '-5403641055608078594', '-5403641055608078594'], kwargs=None)], '8309987831354380420': ['8309987831354380420', CallNode(function='Abstraction.create_variable', type_params={'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['4137488412078958761'], kwargs=None)], '-1975394213187693597': ['-1975394213187693597', CallNode(function='Integer.__add__', type_params=None, args=['4242784867114875566', '8309987831354380420'], kwargs=None)], '-1854422537929804929': ['-1854422537929804929', CallNode(function='Abstraction.create', type_params={'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['8309987831354380420', '-1975394213187693597'], kwargs=None)], '-4744208650310199047': ['-8318583875699831496', CallNode(function='Abstraction.create', type_params={'U': DeclaredTypeInstance(type='Abstraction', params={'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['4242784867114875566', '-1854422537929804929'], kwargs=None)], '2012822640849995423': ['2012822640849995423', CallNode(function='FunctionTwo.create', type_params={'V': DeclaredTypeInstance(type='Integer', params=None), 'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['-2626880919931084916', '-4744208650310199047'], kwargs=None)], '-8318583875699831496': ['-8318583875699831496', CallNode(function='FunctionTwo.abstraction', type_params={'V': DeclaredTypeInstance(type='Integer', params=None), 'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['2012822640849995423'], kwargs=None)], '-8780721530241323099': ['-8780721530241323099', CallNode(function='Abstraction.__call__', type_params={'U': DeclaredTypeInstance(type='Abstraction', params={'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['-8318583875699831496', '-5403641055608078594'], kwargs=None)], '-8899406230380256572': ['-5193555912603863371', CallNode(function='Abstraction.__call__', type_params={'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['-8780721530241323099', '-5403641055608078594'], kwargs=None)], '-7189304769722504649': ['-8780721530241323099', CallNode(function='Abstraction.__call__', type_params={'U': DeclaredTypeInstance(type='Abstraction', params={'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['-4744208650310199047', '-5403641055608078594'], kwargs=None)], '-4018810008853743222': ['-5193555912603863371', CallNode(function='Abstraction.__call__', type_params={'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['-7189304769722504649', '-5403641055608078594'], kwargs=None)], '5952552831974933580': ['5952552831974933580', CallNode(function='Integer.__add__', type_params=None, args=['-5403641055608078594', '8309987831354380420'], kwargs=None)], '-1224448140870306284': ['-8780721530241323099', CallNode(function='Abstraction.create', type_params={'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['8309987831354380420', '5952552831974933580'], kwargs=None)], '4016958901431624490': ['-5193555912603863371', CallNode(function='Abstraction.__call__', type_params={'U': DeclaredTypeInstance(type='Integer', params=None), 'T': DeclaredTypeInstance(type='Integer', params=None)}, args=['-1224448140870306284', '-5403641055608078594'], kwargs=None)], '3080290470961596757': ['-5193555912603863371', CallNode(function='Integer.__add__', type_params=None, args=['-5403641055608078594', '-5403641055608078594'], kwargs=None)], '-7790802924073354291': ['-7790802924073354291', PrimitiveNode(type='int', repr='2')], '-621304054306896899': ['-5193555912603863371', CallNode(function='Integer.from_int', type_params=None, args=['-7790802924073354291'], kwargs=None)]}, states=States(initial='-5193555912603863371', states=[State(node='-8273268554068208387', rule='metadsl_core.function.FunctionTwo.from_fn', label=None), State(node='694123181974341849', rule='metadsl_core.abstraction.Abstraction.from_fn', label=None), State(node='7485432333345578442', rule='metadsl_core.abstraction.Abstraction.from_fn', label=None), State(node='-8899406230380256572', rule='metadsl_core.function.two_call', label=None), State(node='-4018810008853743222', rule='metadsl_core.function.two_abstraction', label=None), State(node='4016958901431624490', rule='metadsl_core.abstraction.beta_reduce', label=None), State(node='3080290470961596757', rule='metadsl_core.abstraction.beta_reduce', label=None), State(node='-621304054306896899', rule='metadsl_core.integer.integer_math', label=None), State(node='-621304054306896899', rule='', label='core')]))"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "entring scope <function Abstraction.from_fn at 0x11118c048>\n",
      "done\n",
      "entring scope <function FunctionTwo.create at 0x115872f28>\n",
      "done\n",
      "getting typevars <function FunctionTwo.from_fn.<locals>.inner at 0x115cc9f28> {~U: <class 'metadsl_core.integer.Integer'>, ~T: <class 'metadsl_core.integer.Integer'>, ~V: <class 'metadsl_core.integer.Integer'>}\n",
      "entring scope <function Abstraction.create_variable at 0x11118c0d0>\n",
      "done\n",
      "entring scope <function Abstraction.from_fn at 0x11118c048>\n",
      "done\n",
      "getting typevars <function FunctionTwo.from_fn.<locals>.inner.<locals>.inner_inner at 0x115cce2f0> {}\n",
      "entring scope <function Abstraction.create at 0x11117bea0>\n",
      "done\n",
      "getting typevars <function FunctionTwo.from_fn.<locals>.inner.<locals>.inner_inner at 0x115cce2f0> {~T: <class 'metadsl_core.integer.Integer'>, ~U: metadsl_core.abstraction.Abstraction[metadsl_core.integer.Integer, metadsl_core.integer.Integer]}\n",
      "entring scope <function Abstraction.create_variable at 0x11118c0d0>\n",
      "done\n",
      "entring scope <function Integer.__add__ at 0x1111aa7b8>\n",
      "done\n",
      "entring scope <function Abstraction.create at 0x11117bea0>\n",
      "done\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/local/miniconda3/envs/metadsl/lib/python3.7/site-packages/metadsl_visualize/typez.py:123: RuntimeWarning: Unresolved typevar in type argument, this means the typing is broken\n",
      "  RuntimeWarning,\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "entring scope <function FunctionTwo.__call__ at 0x115872ea0>\n",
      "done\n",
      "entring scope <function FunctionTwo.abstraction at 0x115861bf8>\n",
      "done\n",
      "entring scope <function Abstraction.__call__ at 0x11117bf28>\n",
      "done\n",
      "entring scope <function Abstraction.__call__ at 0x11117bf28>\n",
      "done\n",
      "replacing typevars metadsl_core.function.two_call\n",
      "entring scope <function FunctionTwo.create at 0x115872f28>\n",
      "done\n",
      "entring scope <function FunctionTwo.abstraction at 0x115861bf8>\n",
      "done\n",
      "replacing typevars metadsl_core.function.two_abstraction\n",
      "entring scope <function Abstraction.create at 0x11117bea0>\n",
      "done\n",
      "entring scope <function Abstraction.__call__ at 0x11117bf28>\n",
      "done\n",
      "entring scope <function Abstraction.create_variable at 0x11118c0d0>\n",
      "done\n",
      "entring scope <function Abstraction.create_variable at 0x11118c0d0>\n",
      "done\n",
      "entring scope <function Integer.__add__ at 0x1111aa7b8>\n",
      "done\n",
      "entring scope <function Abstraction.create at 0x11117bea0>\n",
      "done\n",
      "replacing typevars metadsl_core.abstraction.beta_reduce\n",
      "entring scope <function Abstraction.create at 0x11117bea0>\n",
      "done\n",
      "entring scope <function Abstraction.__call__ at 0x11117bf28>\n",
      "done\n",
      "entring scope <function Integer.from_int at 0x1111aaea0>\n",
      "done\n",
      "entring scope <function Integer.__add__ at 0x1111aa7b8>\n",
      "done\n",
      "replacing typevars metadsl_core.abstraction.beta_reduce\n",
      "entring scope <function Integer.from_int at 0x1111aaea0>\n",
      "done\n",
      "entring scope <function Integer.from_int at 0x1111aaea0>\n",
      "done\n",
      "entring scope <function Integer.__add__ at 0x1111aa7b8>\n",
      "done\n",
      "entring scope <function Integer.from_int at 0x1111aaea0>\n",
      "done\n",
      "entring scope <function Integer.from_int at 0x1111aaea0>\n",
      "done\n",
      "entring scope <function Integer.__sub__ at 0x1111aa6a8>\n",
      "done\n",
      "entring scope <function Integer.from_int at 0x1111aaea0>\n",
      "done\n",
      "entring scope <function Integer.from_int at 0x1111aaea0>\n",
      "done\n",
      "entring scope <function Integer.__mul__ at 0x1111a3268>\n",
      "done\n",
      "entring scope <function Integer.from_int at 0x1111aaea0>\n",
      "done\n",
      "replacing typevars metadsl_core.integer.integer_math\n"
     ]
    }
   ],
   "source": [
    "res._ipython_display_()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
